﻿<common:ViewBase x:Class="Ultimate.Home.Views.HomeMainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:common="http://schemas.ultimatedemo.com/2012/xaml/presentation"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:prism="http://www.codeplex.com/prism"
    xmlns:ultimate="http://schemas.ultimatenavigationframework.com/2011/xaml/presentation"               
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="800">
    
    <Grid x:Name="LayoutRoot" Background="LightGreen">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <!--Note: RegionName must be unique across application-->
        <toolkit:BusyIndicator BusyContent="{Binding ProgressValue, ElementName=NavigationFrame}"
                               IsBusy="{Binding IsBusy, ElementName=NavigationFrame}">
            <ultimate:UltimateNavigationFrame x:Name="NavigationFrame"                                                  
                                                  NavigationFailed="Frame_NavigationFailed"
                                                  prism:RegionManager.RegionName="HomeNavigationRegion">
                <ultimate:UltimateNavigationFrame.UriMapper>
                    <ultimate:UltimateNavigationUriMapper>

                        <ultimate:UltimateNavigationUriMapping Uri="/Home"
                                                               MappedUri="/HomeNavigationView"/>
                        <ultimate:UltimateNavigationUriMapping Uri="/Home/Sub/{id}/Inner/{innerId}"
                                                               MappedUri="/HomeNavigationView" />
                        <ultimate:UltimateNavigationUriMapping Uri="/Home/Sub/{id}"
                                                               MappedUri="/HomeNavigationView" />
                    </ultimate:UltimateNavigationUriMapper>
                </ultimate:UltimateNavigationFrame.UriMapper>
                <!--Handles all exception to ErrorView-->
                <ultimate:ErrorPage ErrorPageUri="/ErrorView"
                                      ExceptionType="Exception" />
            </ultimate:UltimateNavigationFrame>
        </toolkit:BusyIndicator>
        <StackPanel Grid.Column="1">
            <TextBlock FontSize="20" Text="Home"/>
            <TextBlock FontSize="12" Text="This is the home frame"/>
            <!--Note: RegionName must be unique across application-->
            <toolkit:BusyIndicator Grid.Row="1"         
                               BusyContent="{Binding ProgressValue, ElementName=MainFrame}"
                               IsBusy="{Binding IsBusy, ElementName=MainFrame}">
                <ultimate:UltimateNavigationFrame x:Name="MainFrame"
                                                  NavigationFailed="Frame_NavigationFailed"
                                                  prism:RegionManager.RegionName="HomeRegion">
                    <ultimate:UltimateNavigationFrame.UriMapper>
                        <ultimate:UltimateNavigationUriMapper>
                            <ultimate:UltimateNavigationUriMapping Uri="/Home"
                                                               MappedUri="/HomeSubView?id=1"/>
                            <ultimate:UltimateNavigationUriMapping Uri="/Home/Sub/{id}/Inner/{innerId}"
                                                               MappedUri="/HomeSubView?id={id}"
                                                               IsChildFrame="True"/>
                            <ultimate:UltimateNavigationUriMapping Uri="/Home/Sub/{id}"
                                                               MappedUri="/HomeSubView?id={id}" />
                        </ultimate:UltimateNavigationUriMapper>
                    </ultimate:UltimateNavigationFrame.UriMapper>
                    <!--Handles all exception to ErrorView-->
                    <ultimate:ErrorPage ErrorPageUri="/ErrorView"
                                      ExceptionType="Exception" />
                </ultimate:UltimateNavigationFrame>
            </toolkit:BusyIndicator>
        </StackPanel>
    </Grid>
</common:ViewBase>
